package crud.client.service;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

import crud.client.data.Colonne;
import crud.client.data.ColonneToOne;
import crud.client.data.DataView;
import crud.client.data.LigneDonnee;
import crud.client.data.Table;
import crud.client.data.authentication.User;

public interface CRUDServiceAsync
{
	public void getTableList(AsyncCallback<List<Table>> callback);

	public void getColonneList(Table table, AsyncCallback<List<Colonne>> callback);

	public void getDonneeLineList(Table table, List<Colonne> colonneList, AsyncCallback<List<LigneDonnee>> callback);
	public void getDataList(ColonneToOne colonneToOne, AsyncCallback<List<DataView>> callback);

	public void updateData(Table table, List<LigneDonnee> donneeListToDelete, List<LigneDonnee> donneeListToSave, AsyncCallback<Void> callback);
	public void isDataUsed(Table table, LigneDonnee ligneDonneeToCheck, AsyncCallback<Boolean> callback);

	void getEmptyDataViewListCallback(AsyncCallback<List<DataView>> callback);
	void getTableCatalogue(String codeTable, AsyncCallback<List<DataView>> callback);
	void getLigneCatalogue(String codeTable, String codeDetail, AsyncCallback<DataView> callback);
	void getLibelleCatalogue(String codeTable, String codeDetail, AsyncCallback<String> callback);

	void authenticate(String login, String password, AsyncCallback<User> callback);

	void authenticationRequired(AsyncCallback<Boolean> callback);

	void getAuthenticatedUser(AsyncCallback<User> callback);
}